home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6010 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.voicenet.com!news
  2. From: kobak@voicenet.com (Peter Kobak)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Constructor Called for Global Class Instance
  5. Date: 7 Feb 1996 22:42:13 GMT
  6. Organization: Voicenet - Internet Access - (215)674-9290
  7. Message-ID: <4fb9s5$dpd@news.voicenet.com>
  8. NNTP-Posting-Host: ivyland253.voicenet.com
  9. X-Newsreader: NeoLogic News for OS/2 [version: 4.2]
  10.  
  11. In message <4f94ri$12p@dub-news-svc-3.compuserve.com> - 
  12. <72421.1131@compuserve.com> writes:
  13. :>// Snipet
  14. :>#include "MyClass.h"
  15. :>MyClass junk;
  16. :>
  17. :>int main(int ac, char **av)
  18. :>{
  19. :>
  20. :>etc....
  21. :>
  22. :>Given that there is a constructor MyClass(), if I load this sucker up in a debugger
  23. :>and set a breakpoint in the constructor function, should I break in the function? 
  24.  
  25. Yes, assuming your debugger knows what it's doing.
  26.  
  27. :>In other words, does the constructor of a class get called when the class is
  28. :>defined outside of an executed function?
  29.  
  30. Yes, before main().
  31.  
  32. :>And if this is a RTF FAQ, sorry; please point to the FAQ.
  33.  
  34. rtfm.mit.edu/pub/usenet/comp.lang.c++/*
  35.  
  36. ================
  37. Peter Kobak
  38. kobak@voicenet.com
  39.  
  40.